package com.tt.dao;

import com.tt.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by zangzhonghua on 2017/9/22.
 */
@Component
public interface UserDao extends JpaRepository<User, Long> {
    List<User> findByUserName(String userName);

    @Query("select u from User u where u.email = ?")
    List<User> findByEmail(String email);
}
